home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume22 / byte-benchmarks / part04 < prev    next >
Encoding:
Internet Message Format  |  1990-06-07  |  38.2 KB

  1. Subject:  v22i031:  Byte Unix benchmarks, Part04/05
  2. Newsgroups: comp.sources.unix
  3. Approved: rsalz@uunet.UU.NET
  4. X-Checksum-Snefru: 300af420 0344f14e 383b8fec ebbfc462
  5.  
  6. Submitted-by: "Ben Smith @ BYTE" <ben@bytepb.byte.com>
  7. Posting-number: Volume 22, Issue 31
  8. Archive-name: byte-benchmarks/part04
  9.  
  10. #! /bin/sh
  11. # This is a shell archive.  Remove anything before this line, then unpack
  12. # it by saving it into a file and typing "sh file".  To overwrite existing
  13. # files, type "sh file -c".  You can also feed this as standard input via
  14. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  15. # will see the following message at the end:
  16. #        "End of archive 4 (of 5)."
  17. # Contents:  dhry.c dhry.h
  18. # Wrapped by rsalz@papaya.bbn.com on Tue May  8 08:55:33 1990
  19. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  20. if test -f 'dhry.c' -a "${1}" != "-c" ; then 
  21.   echo shar: Will not clobber existing file \"'dhry.c'\"
  22. else
  23. echo shar: Extracting \"'dhry.c'\" \(17085 characters\)
  24. sed "s/^X//" >'dhry.c' <<'END_OF_FILE'
  25. X/*******************************************************************************
  26. X *  The BYTE UNIX Benchmarks - Release 2
  27. X *          Module: dhry.c   SID: 2.4 4/17/90 16:45:30
  28. X *          
  29. X *******************************************************************************
  30. X * Bug reports, patches, comments, suggestions should be sent to:
  31. X *
  32. X *    Ben Smith or Rick Grehan at BYTE Magazine
  33. X *    bensmith@bixpb.UUCP    rick_g@bixpb.UUCP
  34. X *
  35. X *******************************************************************************
  36. X *  Modification Log:
  37. X * adapted from: "DHRYSTONE" Benchmark Program
  38. X *  Version:    C, Version 2.0
  39. X *  File:       dhry_pack_1.c (part 2 of 3)
  40. X *  Date:       March 3, 1988
  41. X *  Author:     Reinhold P. Weicker
  42. X * added command line parameter handling, modified error check
  43. X * to output only on error - ben 6/89
  44. X *
  45. X ******************************************************************************/
  46. Xchar id[] = "@(#) @(#)dhry.c:2.4 -- 4/17/90 16:45:30";
  47. X
  48. X#include "dhry.h"
  49. X
  50. X/* Global Variables: */
  51. X
  52. XRec_Pointer     Ptr_Glob,
  53. X                Next_Ptr_Glob;
  54. Xint             Int_Glob;
  55. XBoolean         Bool_Glob;
  56. Xchar            Ch_1_Glob,
  57. X                Ch_2_Glob;
  58. Xint             Arr_1_Glob [50];
  59. Xint             Arr_2_Glob [50] [50];
  60. X
  61. Xextern char     *malloc ();
  62. XEnumeration     Func_1 ();
  63. X  /* forward declaration necessary since Enumeration may not simply be int */
  64. X
  65. X#ifndef REG
  66. X        Boolean Reg = false;
  67. X#define REG
  68. X        /* REG becomes defined as empty */
  69. X        /* i.e. no register variables   */
  70. X#else
  71. X        Boolean Reg = true;
  72. X#endif
  73. X
  74. X/* variables for time measurement: */
  75. X
  76. X#ifdef TIMES
  77. Xstruct tms      time_info;
  78. Xextern  int     times ();
  79. X                /* see library function "times" */
  80. X#endif
  81. X#ifdef TIME
  82. Xextern long     time();
  83. X                /* see library function "time"  */
  84. X#endif
  85. X
  86. X#define Too_Small_Time 2
  87. X                /* Measurements should last at least 2 seconds */
  88. X
  89. Xlong            Begin_Time,
  90. X                End_Time,
  91. X                User_Time;
  92. Xfloat           Microseconds,
  93. X                Dhrystones_Per_Second;
  94. X
  95. X/* end of variables for time measurement */
  96. X
  97. X
  98. Xmain (argc, argv, env)
  99. Xint argc;
  100. Xchar *argv[], *env[];
  101. X  /* main program, corresponds to procedures        */
  102. X  /* Main and Proc_0 in the Ada version             */
  103. X
  104. X{
  105. X        One_Fifty       Int_1_Loc;
  106. X  REG   One_Fifty       Int_2_Loc;
  107. X        One_Fifty       Int_3_Loc;
  108. X  REG   char            Ch_Index;
  109. X        Enumeration     Enum_Loc;
  110. X        Str_30          Str_1_Loc;
  111. X        Str_30          Str_2_Loc;
  112. X  REG   int             Run_Index;
  113. X  REG   int             Number_Of_Runs = 10000;
  114. X
  115. X
  116. X  /* Initializations */
  117. X
  118. X  Next_Ptr_Glob = (Rec_Pointer) malloc (sizeof (Rec_Type));
  119. X  Ptr_Glob = (Rec_Pointer) malloc (sizeof (Rec_Type));
  120. X
  121. X  Ptr_Glob->Ptr_Comp                    = Next_Ptr_Glob;
  122. X  Ptr_Glob->Discr                       = Ident_1;
  123. X  Ptr_Glob->variant.var_1.Enum_Comp     = Ident_3;
  124. X  Ptr_Glob->variant.var_1.Int_Comp      = 40;
  125. X  strcpy (Ptr_Glob->variant.var_1.Str_Comp, STR_0_PAR_REF);
  126. X  strcpy (Str_1_Loc, STR_1_PAR_REF);
  127. X
  128. X  Arr_2_Glob [8][7] = 10;
  129. X        /* Was missing in published program. Without this               */
  130. X        /* initialization, Arr_2_Glob [8][7] would have an              */
  131. X        /* undefined value.                                             */
  132. X        /* Warning: With 16-Bit processors and Number_Of_Runs > 32000,  */
  133. X        /* overflow may occur for this array element.                   */
  134. X
  135. X  if(argc > 1) Number_Of_Runs = atoi(argv[1]);
  136. X  /***************/
  137. X  /* Start timer */
  138. X  /***************/
  139. X#ifdef TIMES
  140. X  times (&time_info);
  141. X  Begin_Time = (long) time_info.tms_utime;
  142. X#endif
  143. X#ifdef TIME
  144. X  Begin_Time = time ( (long *) 0);
  145. X#endif
  146. X
  147. X  for (Run_Index = 1; Run_Index <= Number_Of_Runs; ++Run_Index)
  148. X  {
  149. X
  150. X    Proc_5();
  151. X    Proc_4();
  152. X      /* Ch_1_Glob == 'A', Ch_2_Glob == 'B', Bool_Glob == true */
  153. X    Int_1_Loc = 2;
  154. X    Int_2_Loc = 3;
  155. X    strcpy (Str_2_Loc, "DHRYSTONE PROGRAM, 2'ND STRING");
  156. X    Enum_Loc = Ident_2;
  157. X    Bool_Glob = ! Func_2 (Str_1_Loc, Str_2_Loc);
  158. X      /* Bool_Glob == 1 */
  159. X    while (Int_1_Loc < Int_2_Loc)  /* loop body executed once */
  160. X    {
  161. X      Int_3_Loc = 5 * Int_1_Loc - Int_2_Loc;
  162. X        /* Int_3_Loc == 7 */
  163. X      Proc_7 (Int_1_Loc, Int_2_Loc, &Int_3_Loc);
  164. X        /* Int_3_Loc == 7 */
  165. X      Int_1_Loc += 1;
  166. X    } /* while */
  167. X      /* Int_1_Loc == 3, Int_2_Loc == 3, Int_3_Loc == 7 */
  168. X    Proc_8 (Arr_1_Glob, Arr_2_Glob, Int_1_Loc, Int_3_Loc);
  169. X      /* Int_Glob == 5 */
  170. X    Proc_1 (Ptr_Glob);
  171. X    for (Ch_Index = 'A'; Ch_Index <= Ch_2_Glob; ++Ch_Index)
  172. X                             /* loop body executed twice */
  173. X    {
  174. X      if (Enum_Loc == Func_1 (Ch_Index, 'C'))
  175. X          /* then, not executed */
  176. X        {
  177. X        Proc_6 (Ident_1, &Enum_Loc);
  178. X        strcpy (Str_2_Loc, "DHRYSTONE PROGRAM, 3'RD STRING");
  179. X        Int_2_Loc = Run_Index;
  180. X        Int_Glob = Run_Index;
  181. X        }
  182. X    }
  183. X      /* Int_1_Loc == 3, Int_2_Loc == 3, Int_3_Loc == 7 */
  184. X    Int_2_Loc = Int_2_Loc * Int_1_Loc;
  185. X    Int_1_Loc = Int_2_Loc / Int_3_Loc;
  186. X    Int_2_Loc = 7 * (Int_2_Loc - Int_3_Loc) - Int_1_Loc;
  187. X      /* Int_1_Loc == 1, Int_2_Loc == 13, Int_3_Loc == 7 */
  188. X    Proc_2 (&Int_1_Loc);
  189. X      /* Int_1_Loc == 5 */
  190. X
  191. X  } /* loop "for Run_Index" */
  192. X
  193. X  /**************/
  194. X  /* Stop timer */
  195. X  /**************/
  196. X  
  197. X#ifdef TIMES
  198. X  times (&time_info);
  199. X  End_Time = (long) time_info.tms_utime;
  200. X#endif
  201. X#ifdef TIME
  202. X  End_Time = time ( (long *) 0);
  203. X#endif
  204. X
  205. X  if(Int_Glob != INT_GLOB)
  206. X    {
  207. X      fprintf (stderr, "Int_Glob:            %d\n", Int_Glob);
  208. X      fprintf (stderr, "        should be:   %d\n", INT_GLOB);
  209. X    }
  210. X  if(Bool_Glob != BOOL_GLOB)
  211. X    {
  212. X      fprintf (stderr, "Bool_Glob:           %d\n", Bool_Glob);
  213. X      fprintf (stderr, "        should be:   %d\n", BOOL_GLOB);
  214. X    }
  215. X  if(Ch_1_Glob != 'A')
  216. X    {
  217. X      fprintf (stderr, "Ch_1_Glob:           %c\n", Ch_1_Glob);
  218. X      fprintf (stderr, "        should be:   %c\n", 'A');
  219. X    }
  220. X  if(Ch_2_Glob != 'B')
  221. X    {
  222. X      fprintf (stderr, "Ch_2_Glob:           %c\n", Ch_2_Glob);
  223. X      fprintf (stderr, "        should be:   %c\n", 'B');
  224. X    }
  225. X  if(Arr_1_Glob[ARR_1_SZ] != ARR_1_VAL)
  226. X    {
  227. X      fprintf (stderr, "Arr_1_Glob[%d]:       %d\n", ARR_1_SZ, Arr_1_Glob[ARR_1_SZ]);
  228. X      fprintf (stderr, "        should be:   %d\n", ARR_1_VAL);
  229. X    }
  230. X  if(Arr_2_Glob[8][7] != (Number_Of_Runs + 10))
  231. X    {
  232. X      fprintf (stderr, "Arr_2_Glob[8][7]:    %d\n", Arr_2_Glob[8][7]);
  233. X      fprintf (stderr, "        should be:   %d\n",Number_Of_Runs + 10);
  234. X    }
  235. X  if(Ptr_Glob->Discr != Ident_1)
  236. X    {
  237. X      fprintf (stderr, "  Discr:             %d\n", Ptr_Glob->Discr);
  238. X      fprintf (stderr, "        should be:   %d\n", Ident_1);
  239. X    }
  240. X#ifdef COMPLETE
  241. X  if(Ptr_Glob->variant.var_1.Enum_Comp != 2)
  242. X    {
  243. X      fprintf (stderr, "  Enum_Comp:         %d\n", Ptr_Glob->variant.var_1.Enum_Comp);
  244. X      fprintf (stderr, "        should be:   %d\n", 2);
  245. X    }
  246. X    {
  247. X  fprintf (stderr, "  Int_Comp:          %d\n", Ptr_Glob->variant.var_1.Int_Comp);
  248. X  fprintf (stderr, "        should be:   %d\n", 17);
  249. X    }
  250. X    {
  251. X  fprintf (stderr, "  Str_Comp:          %s\n", Ptr_Glob->variant.var_1.Str_Comp);
  252. X  fprintf (stderr, "        should be:   %s\n", STR_0_PAR_REF);
  253. X    }
  254. X    {
  255. X  fprintf (stderr, "Next_Ptr_Glob->\n");
  256. X  fprintf (stderr, "  Ptr_Comp:          %d\n", (int) Next_Ptr_Glob->Ptr_Comp);
  257. X  fprintf (stderr, "        should be:   (implementation-dependent), same as above\n");
  258. X    }
  259. X    {
  260. X  fprintf (stderr, "  Discr:             %d\n", Next_Ptr_Glob->Discr);
  261. X  fprintf (stderr, "        should be:   %d\n", 0);
  262. X    }
  263. X    {
  264. X  fprintf (stderr, "  Enum_Comp:         %d\n", Next_Ptr_Glob->variant.var_1.Enum_Comp);
  265. X  fprintf (stderr, "        should be:   %d\n", 1);
  266. X    }
  267. X    {
  268. X  fprintf (stderr, "  Int_Comp:          %d\n", Next_Ptr_Glob->variant.var_1.Int_Comp);
  269. X  fprintf (stderr, "        should be:   %d\n", 18);
  270. X    }
  271. X#endif
  272. Xif(strcmp(Next_Ptr_Glob->variant.var_1.Str_Comp, STR_0_PAR_REF))
  273. X    {
  274. X  fprintf (stderr, "  Str_Comp:          %s\n",
  275. X                                Next_Ptr_Glob->variant.var_1.Str_Comp);
  276. X  fprintf (stderr, "        should be:   %s\n",STR_0_PAR_REF);
  277. X    }
  278. X#ifdef COMPLETE
  279. X    {
  280. X  fprintf (stderr, "Int_1_Loc:           %d\n", Int_1_Loc);
  281. X  fprintf (stderr, "        should be:   %d\n", 5);
  282. X    }
  283. X    {
  284. X  fprintf (stderr, "Int_2_Loc:           %d\n", Int_2_Loc);
  285. X  fprintf (stderr, "        should be:   %d\n", 13);
  286. X    }
  287. X    {
  288. X  fprintf (stderr, "Int_3_Loc:           %d\n", Int_3_Loc);
  289. X  fprintf (stderr, "        should be:   %d\n", 7);
  290. X    }
  291. X    {
  292. X  fprintf (stderr, "Enum_Loc:            %d\n", Enum_Loc);
  293. X  fprintf (stderr, "        should be:   %d\n", 1);
  294. X    }
  295. X#endif
  296. X  if(strcmp(Str_1_Loc, STR_1_PAR_REF))
  297. X    {
  298. X      fprintf (stderr, "Str_1_Loc:           %s\n", Str_1_Loc);
  299. X      fprintf (stderr, "        should be:   %s\n",STR_1_PAR_REF);
  300. X    }
  301. X  if(strcmp(Str_2_Loc, STR_2_PAR_REF))
  302. X    {
  303. X      fprintf (stderr, "Str_2_Loc:           %s\n", Str_2_Loc);
  304. X      fprintf (stderr, "        should be:   %s\n",STR_2_PAR_REF);
  305. X        }
  306. X
  307. X  User_Time = End_Time - Begin_Time;
  308. X
  309. X  if (User_Time < Too_Small_Time)
  310. X  {
  311. X    fprintf (stderr, "Measured time too small to obtain meaningful results\n");
  312. X    fprintf (stderr, "Please increase number of runs\n");
  313. X    fprintf (stderr, "\n");
  314. X  }
  315. X  else
  316. X  {
  317. X#ifdef TIME
  318. X    Microseconds = (float) User_Time * Mic_secs_Per_Second 
  319. X                        / (float) Number_Of_Runs;
  320. X    Dhrystones_Per_Second = (float) Number_Of_Runs / (float) User_Time;
  321. X#else
  322. X    Microseconds = (float) User_Time * Mic_secs_Per_Second 
  323. X                        / ((float) HZ * ((float) Number_Of_Runs));
  324. X    Dhrystones_Per_Second = ((float) HZ * (float) Number_Of_Runs)
  325. X                        / (float) User_Time;
  326. X#endif
  327. X/************** The results go to standard out *********************/
  328. X    fprintf (stderr,"Microseconds for one run through Dhrystone: ");
  329. X    fprintf (stderr,"%6.1f \n", Microseconds);
  330. X    fprintf (stderr,"Dhrystones per Second:                      ");
  331. X    fprintf (stderr,"%6.1f \n", Dhrystones_Per_Second);
  332. X    fprintf (stderr,"\n");
  333. X  }
  334. X  
  335. X}
  336. X
  337. X
  338. XProc_1 (Ptr_Val_Par)
  339. X/**********************/
  340. X
  341. XREG Rec_Pointer Ptr_Val_Par;
  342. X    /* executed once */
  343. X{
  344. X  REG Rec_Pointer Next_Record = Ptr_Val_Par->Ptr_Comp;  
  345. X                                        /* == Ptr_Glob_Next */
  346. X  /* Local variable, initialized with Ptr_Val_Par->Ptr_Comp,    */
  347. X  /* corresponds to "rename" in Ada, "with" in Pascal           */
  348. X  
  349. X  structassign (*Ptr_Val_Par->Ptr_Comp, *Ptr_Glob); 
  350. X  Ptr_Val_Par->variant.var_1.Int_Comp = 5;
  351. X  Next_Record->variant.var_1.Int_Comp 
  352. X        = Ptr_Val_Par->variant.var_1.Int_Comp;
  353. X  Next_Record->Ptr_Comp = Ptr_Val_Par->Ptr_Comp;
  354. X  Proc_3 (&Next_Record->Ptr_Comp);
  355. X    /* Ptr_Val_Par->Ptr_Comp->Ptr_Comp 
  356. X                        == Ptr_Glob->Ptr_Comp */
  357. X  if (Next_Record->Discr == Ident_1)
  358. X    /* then, executed */
  359. X  {
  360. X    Next_Record->variant.var_1.Int_Comp = 6;
  361. X    Proc_6 (Ptr_Val_Par->variant.var_1.Enum_Comp, 
  362. X           &Next_Record->variant.var_1.Enum_Comp);
  363. X    Next_Record->Ptr_Comp = Ptr_Glob->Ptr_Comp;
  364. X    Proc_7 (Next_Record->variant.var_1.Int_Comp, 10, 
  365. X           &Next_Record->variant.var_1.Int_Comp);
  366. X  }
  367. X  else /* not executed */
  368. X    structassign (*Ptr_Val_Par, *Ptr_Val_Par->Ptr_Comp);
  369. X} /* Proc_1 */
  370. X
  371. X
  372. XProc_2 (Int_Par_Ref)
  373. X/******************/
  374. X    /* executed once */
  375. X    /* *Int_Par_Ref == 1, becomes 4 */
  376. X
  377. XOne_Fifty   *Int_Par_Ref;
  378. X{
  379. X  One_Fifty  Int_Loc;  
  380. X  Enumeration   Enum_Loc;
  381. X
  382. X  Int_Loc = *Int_Par_Ref + 10;
  383. X  do /* executed once */
  384. X    if (Ch_1_Glob == 'A')
  385. X      /* then, executed */
  386. X    {
  387. X      Int_Loc -= 1;
  388. X      *Int_Par_Ref = Int_Loc - Int_Glob;
  389. X      Enum_Loc = Ident_1;
  390. X    } /* if */
  391. X  while (Enum_Loc != Ident_1); /* true */
  392. X} /* Proc_2 */
  393. X
  394. X
  395. XProc_3 (Ptr_Ref_Par)
  396. X/**********************/
  397. X    /* executed once */
  398. X    /* Ptr_Ref_Par becomes Ptr_Glob */
  399. X
  400. XRec_Pointer *Ptr_Ref_Par;
  401. X
  402. X{
  403. X  if (Ptr_Glob != Null)
  404. X    /* then, executed */
  405. X    *Ptr_Ref_Par = Ptr_Glob->Ptr_Comp;
  406. X  else /* not executed */
  407. X    Int_Glob = 100;
  408. X  Proc_7 (10, Int_Glob, &Ptr_Glob->variant.var_1.Int_Comp);
  409. X} /* Proc_3 */
  410. X
  411. X
  412. X
  413. XProc_4 () /* without parameters */
  414. X/*******/
  415. X    /* executed once */
  416. X{
  417. X  Boolean Bool_Loc;
  418. X
  419. X  Bool_Loc = Ch_1_Glob == 'A';
  420. X  Bool_Glob = Bool_Loc | Bool_Glob;
  421. X  Ch_2_Glob = 'B';
  422. X} /* Proc_4 */
  423. X
  424. X
  425. XProc_5 () /* without parameters */
  426. X/*******/
  427. X    /* executed once */
  428. X{
  429. X  Ch_1_Glob = 'A';
  430. X  Bool_Glob = false;
  431. X} /* Proc_5 */
  432. X
  433. X
  434. X        /* Procedure for the assignment of structures,          */
  435. X        /* if the C compiler doesn't support this feature       */
  436. X#ifdef  NOSTRUCTASSIGN
  437. Xmemcpy (d, s, l)
  438. Xregister char   *d;
  439. Xregister char   *s;
  440. Xregister int    l;
  441. X{
  442. X        while (l--) *d++ = *s++;
  443. X}
  444. X#endif
  445. X
  446. X/*****************************************************************
  447. X                      THE PROCESSES
  448. X *****************************************************************/
  449. XProc_6 (Enum_Val_Par, Enum_Ref_Par)
  450. X/*********************************/
  451. X    /* executed once */
  452. X    /* Enum_Val_Par == Ident_3, Enum_Ref_Par becomes Ident_2 */
  453. X
  454. XEnumeration  Enum_Val_Par;
  455. XEnumeration *Enum_Ref_Par;
  456. X{
  457. X  *Enum_Ref_Par = Enum_Val_Par;
  458. X  if (! Func_3 (Enum_Val_Par))
  459. X    /* then, not executed */
  460. X    *Enum_Ref_Par = Ident_4;
  461. X  switch (Enum_Val_Par)
  462. X  {
  463. X    case Ident_1: 
  464. X      *Enum_Ref_Par = Ident_1;
  465. X      break;
  466. X    case Ident_2: 
  467. X      if (Int_Glob > 100)
  468. X        /* then */
  469. X      *Enum_Ref_Par = Ident_1;
  470. X      else *Enum_Ref_Par = Ident_4;
  471. X      break;
  472. X    case Ident_3: /* executed */
  473. X      *Enum_Ref_Par = Ident_2;
  474. X      break;
  475. X    case Ident_4: break;
  476. X    case Ident_5: 
  477. X      *Enum_Ref_Par = Ident_3;
  478. X      break;
  479. X  } /* switch */
  480. X} /* Proc_6 */
  481. X
  482. X
  483. XProc_7 (Int_1_Par_Val, Int_2_Par_Val, Int_Par_Ref)
  484. X/**********************************************/
  485. X    /* executed three times                                      */ 
  486. X    /* first call:      Int_1_Par_Val == 2, Int_2_Par_Val == 3,  */
  487. X    /*                  Int_Par_Ref becomes 7                    */
  488. X    /* second call:     Int_1_Par_Val == 10, Int_2_Par_Val == 5, */
  489. X    /*                  Int_Par_Ref becomes 17                   */
  490. X    /* third call:      Int_1_Par_Val == 6, Int_2_Par_Val == 10, */
  491. X    /*                  Int_Par_Ref becomes 18                   */
  492. XOne_Fifty       Int_1_Par_Val;
  493. XOne_Fifty       Int_2_Par_Val;
  494. XOne_Fifty      *Int_Par_Ref;
  495. X{
  496. X  One_Fifty Int_Loc;
  497. X
  498. X  Int_Loc = Int_1_Par_Val + 2;
  499. X  *Int_Par_Ref = Int_2_Par_Val + Int_Loc;
  500. X} /* Proc_7 */
  501. X
  502. X
  503. XProc_8 (Arr_1_Par_Ref, Arr_2_Par_Ref, Int_1_Par_Val, Int_2_Par_Val)
  504. X/*********************************************************************/
  505. X    /* executed once      */
  506. X    /* Int_Par_Val_1 == 3 */
  507. X    /* Int_Par_Val_2 == 7 */
  508. XArr_1_Dim       Arr_1_Par_Ref;
  509. XArr_2_Dim       Arr_2_Par_Ref;
  510. Xint             Int_1_Par_Val;
  511. Xint             Int_2_Par_Val;
  512. X{
  513. X  REG One_Fifty Int_Index;
  514. X  REG One_Fifty Int_Loc;
  515. X
  516. X  Int_Loc = Int_1_Par_Val + 5;
  517. X  Arr_1_Par_Ref [Int_Loc] = Int_2_Par_Val;
  518. X  Arr_1_Par_Ref [Int_Loc+1] = Arr_1_Par_Ref [Int_Loc];
  519. X  Arr_1_Par_Ref [Int_Loc+30] = Int_Loc;
  520. X  for (Int_Index = Int_Loc; Int_Index <= Int_Loc+1; ++Int_Index)
  521. X    Arr_2_Par_Ref [Int_Loc] [Int_Index] = Int_Loc;
  522. X  Arr_2_Par_Ref [Int_Loc] [Int_Loc-1] += 1;
  523. X  Arr_2_Par_Ref [Int_Loc+20] [Int_Loc] = Arr_1_Par_Ref [Int_Loc];
  524. X  Int_Glob = 5;
  525. X} /* Proc_8 */
  526. X
  527. X
  528. XEnumeration Func_1 (Ch_1_Par_Val, Ch_2_Par_Val)
  529. X/*************************************************/
  530. X    /* executed three times                                         */
  531. X    /* first call:      Ch_1_Par_Val == 'H', Ch_2_Par_Val == 'R'    */
  532. X    /* second call:     Ch_1_Par_Val == 'A', Ch_2_Par_Val == 'C'    */
  533. X    /* third call:      Ch_1_Par_Val == 'B', Ch_2_Par_Val == 'C'    */
  534. X
  535. XCapital_Letter   Ch_1_Par_Val;
  536. XCapital_Letter   Ch_2_Par_Val;
  537. X{
  538. X  Capital_Letter        Ch_1_Loc;
  539. X  Capital_Letter        Ch_2_Loc;
  540. X
  541. X  Ch_1_Loc = Ch_1_Par_Val;
  542. X  Ch_2_Loc = Ch_1_Loc;
  543. X  if (Ch_2_Loc != Ch_2_Par_Val)
  544. X    /* then, executed */
  545. X    return (Ident_1);
  546. X  else  /* not executed */
  547. X  {
  548. X    Ch_1_Glob = Ch_1_Loc;
  549. X    return (Ident_2);
  550. X   }
  551. X} /* Func_1 */
  552. X
  553. X
  554. XBoolean Func_2 (Str_1_Par_Ref, Str_2_Par_Ref)
  555. X/*************************************************/
  556. X    /* executed once */
  557. X    /* Str_1_Par_Ref == "DHRYSTONE PROGRAM, 1'ST STRING" */
  558. X    /* Str_2_Par_Ref == "DHRYSTONE PROGRAM, 2'ND STRING" */
  559. X
  560. XStr_30  Str_1_Par_Ref;
  561. XStr_30  Str_2_Par_Ref;
  562. X{
  563. X  REG One_Thirty        Int_Loc;
  564. X      Capital_Letter    Ch_Loc;
  565. X
  566. X  Int_Loc = 2;
  567. X  while (Int_Loc <= 2) /* loop body executed once */
  568. X    if (Func_1 (Str_1_Par_Ref[Int_Loc],
  569. X                Str_2_Par_Ref[Int_Loc+1]) == Ident_1)
  570. X      /* then, executed */
  571. X    {
  572. X      Ch_Loc = 'A';
  573. X      Int_Loc += 1;
  574. X    } /* if, while */
  575. X  if (Ch_Loc >= 'W' && Ch_Loc < 'Z')
  576. X    /* then, not executed */
  577. X    Int_Loc = 7;
  578. X  if (Ch_Loc == 'R')
  579. X    /* then, not executed */
  580. X    return (true);
  581. X  else /* executed */
  582. X  {
  583. X    if (strcmp (Str_1_Par_Ref, Str_2_Par_Ref) > 0)
  584. X      /* then, not executed */
  585. X    {
  586. X      Int_Loc += 7;
  587. X      Int_Glob = Int_Loc;
  588. X      return (true);
  589. X    }
  590. X    else /* executed */
  591. X      return (false);
  592. X  } /* if Ch_Loc */
  593. X} /* Func_2 */
  594. X
  595. X
  596. XBoolean Func_3 (Enum_Par_Val)
  597. X/***************************/
  598. X    /* executed once        */
  599. X    /* Enum_Par_Val == Ident_3 */
  600. XEnumeration Enum_Par_Val;
  601. X{
  602. X  Enumeration Enum_Loc;
  603. X
  604. X  Enum_Loc = Enum_Par_Val;
  605. X  if (Enum_Loc == Ident_3)
  606. X    /* then, executed */
  607. X    return (true);
  608. X} /* Func_3 */
  609. X
  610. END_OF_FILE
  611. if test 17085 -ne `wc -c <'dhry.c'`; then
  612.     echo shar: \"'dhry.c'\" unpacked with wrong size!
  613. fi
  614. chmod +x 'dhry.c'
  615. # end of 'dhry.c'
  616. fi
  617. if test -f 'dhry.h' -a "${1}" != "-c" ; then 
  618.   echo shar: Will not clobber existing file \"'dhry.h'\"
  619. else
  620. echo shar: Extracting \"'dhry.h'\" \(19075 characters\)
  621. sed "s/^X//" >'dhry.h' <<'END_OF_FILE'
  622. X/*******************************************************************************
  623. X *  The BYTE UNIX Benchmarks - Release 2
  624. X *          Module: dhry.h   SID: 2.4 4/17/90 16:45:38
  625. X *          
  626. X *******************************************************************************
  627. X * Bug reports, patches, comments, suggestions should be sent to:
  628. X *
  629. X *    Ben Smith or Rick Grehan at BYTE Magazine
  630. X *    bensmith@bixpb.UUCP    rick_g@bixpb.UUCP
  631. X *
  632. X *******************************************************************************
  633. X *  Modification Log:
  634. X * addapted from:
  635. X *
  636. X ******************************************************************************/
  637. X/*
  638. X ****************************************************************************
  639. X *
  640. X *                   "DHRYSTONE" Benchmark Program
  641. X *                   -----------------------------
  642. X *                                                                            
  643. X *  Version:    C, Version 2.0
  644. X *                                                                            
  645. X *  File:       dhry_global.h (part 1 of 3)
  646. X *
  647. X *  Date:       March 3, 1988
  648. X *
  649. X *  Author:     Reinhold P. Weicker
  650. X *                      Siemens AG, E STE 35
  651. X *                      Postfach 3240
  652. X *                      8520 Erlangen
  653. X *                      Germany (West)
  654. X *                              Phone:  [xxx-49]-9131-7-20330
  655. X *                                      (8-17 Central European Time)
  656. X *                              Usenet: ..!mcvax!unido!estevax!weicker
  657. X *
  658. X *              Original Version (in Ada) published in
  659. X *              "Communications of the ACM" vol. 27., no. 10 (Oct. 1984),
  660. X *              pp. 1013 - 1030, together with the statistics
  661. X *              on which the distribution of statements etc. is based.
  662. X *
  663. X *              In this C version, the following C library functions are used:
  664. X *              - strcpy, strcmp (inside the measurement loop)
  665. X *              - printf, scanf (outside the measurement loop)
  666. X *              In addition, UNIX system calls "times ()" or "time ()"
  667. X *              are used for execution time measurement. For measurements
  668. X *              on other systems, these calls have to be changed.
  669. X *
  670. X *  Collection of Results:
  671. X *              Reinhold Weicker (address see above) and
  672. X *              
  673. X *              Rick Richardson
  674. X *              PC Research. Inc.
  675. X *              94 Apple Orchard Drive
  676. X *              Tinton Falls, NJ 07724
  677. X *                      Phone:  (201) 834-1378 (9-17 EST)               
  678. X *                      Usenet: ...!seismo!uunet!pcrat!rick
  679. X *
  680. X *      Please send results to Reinhold Weicker and/or Rick Richardson.
  681. X *      Complete information should be given on hardware and software used.
  682. X *      Hardware information includes: Machine type, CPU, type and size
  683. X *      of caches; for microprocessors: clock frequency, memory speed
  684. X *      (number of wait states).
  685. X *      Software information includes: Compiler (and runtime library)
  686. X *      manufacturer and version, compilation switches, OS version.
  687. X *      The Operating System version may give an indication about the
  688. X *      compiler; Dhrystone itself performs no OS calls in the measurement loop.
  689. X *
  690. X *      The complete output generated by the program should be mailed
  691. X *      such that at least some checks for correctness can be made.
  692. X *
  693. X ***************************************************************************
  694. X *
  695. X *  History:    This version C/2.0 has been made for two reasons:
  696. X *
  697. X *              1) There is an obvious need for a common C version of
  698. X *              Dhrystone, since C is at present the most popular system
  699. X *              programming language for the class of processors
  700. X *              (microcomputers, minicomputers) where Dhrystone is used most.
  701. X *              There should be, as far as possible, only one C version of
  702. X *              Dhrystone such that results can be compared without
  703. X *              restrictions. In the past, the C versions distributed
  704. X *              by Rick Richardson (Version 1.1) and by Reinhold Weicker
  705. X *              had small (though not significant) differences.
  706. X *
  707. X *              2) As far as it is possible without changes to the Dhrystone
  708. X *              statistics, optimizing compilers should be prevented from
  709. X *              removing significant statements.
  710. X *
  711. X *              This C version has been developed in cooperation with
  712. X *              Rick Richardson (Tinton Falls, NJ), it incorporates many
  713. X *              ideas from the "Version 1.1" distributed previously by
  714. X *              him over the UNIX network Usenet.
  715. X *              I also thank Chaim Benedelac (National Semiconductor),
  716. X *              David Ditzel (SUN), Earl Killian and John Mashey (MIPS),
  717. X *              Alan Smith and Rafael Saavedra-Barrera (UC at Berkeley)
  718. X *              for their help with comments on earlier versions of the
  719. X *              benchmark.
  720. X *
  721. X *  Changes:    In the initialization part, this version follows mostly
  722. X *              Rick Richardson's version distributed via Usenet, not the
  723. X *              version distributed earlier via floppy disk by Reinhold Weicker.
  724. X *              As a concession to older compilers, names have been made
  725. X *              unique within the first 8 characters.
  726. X *              Inside the measurement loop, this version follows the
  727. X *              version previously distributed by Reinhold Weicker.
  728. X *
  729. X *              At several places in the benchmark, code has been added,
  730. X *              but within the measurement loop only in branches that 
  731. X *              are not executed. The intention is that optimizing compilers
  732. X *              should be prevented from moving code out of the measurement
  733. X *              loop, or from removing code altogether. Since the statements
  734. X *              that are executed within the measurement loop have NOT been
  735. X *              changed, the numbers defining the "Dhrystone distribution"
  736. X *              (distribution of statements, operand types and locality)
  737. X *              still hold. Except for sophisticated optimizing compilers,
  738. X *              execution times for this version should be the same as
  739. X *              for previous versions.
  740. X *              
  741. X *              Since it has proven difficult to subtract the time for the
  742. X *              measurement loop overhead in a correct way, the loop check
  743. X *              has been made a part of the benchmark. This does have
  744. X *              an impact - though a very minor one - on the distribution
  745. X *              statistics which have been updated for this version.
  746. X *
  747. X *              All changes within the measurement loop are described
  748. X *              and discussed in the companion paper "Rationale for
  749. X *              Dhrystone version 2".
  750. X *
  751. X *              Because of the self-imposed limitation that the order and
  752. X *              distribution of the executed statements should not be
  753. X *              changed, there are still cases where optimizing compilers
  754. X *              may not generate code for some statements. To a certain
  755. X *              degree, this is unavoidable for small synthetic benchmarks.
  756. X *              Users of the benchmark are advised to check code listings
  757. X *              whether code is generated for all statements of Dhrystone.
  758. X *
  759. X ***************************************************************************
  760. X *
  761. X * Defines:     The following "Defines" are possible:
  762. X *              -DREG=register          (default: Not defined)
  763. X *                      As an approximation to what an average C programmer
  764. X *                      might do, the "register" storage class is applied
  765. X *                      (if enabled by -DREG=register)
  766. X *                      - for local variables, if they are used (dynamically)
  767. X *                        five or more times
  768. X *                      - for parameters if they are used (dynamically)
  769. X *                        six or more times
  770. X *                      Note that an optimal "register" strategy is
  771. X *                      compiler-dependent, and that "register" declarations
  772. X *                      do not necessarily lead to faster execution.
  773. X *              -DNOSTRUCTASSIGN        (default: Not defined)
  774. X *                      Define if the C compiler does not support
  775. X *                      assignment of structures.
  776. X *              -DNOENUMS               (default: Not defined)
  777. X *                      Define if the C compiler does not support
  778. X *                      enumeration types.
  779. X *              -DTIMES                 (default)
  780. X *              -DTIME
  781. X *                      The "times" function of UNIX (returning process times)
  782. X *                      or the "time" function (returning wallclock time)
  783. X *                      is used for measurement. 
  784. X *                      For single user machines, "time ()" is adequate. For
  785. X *                      multi-user machines where you cannot get single-user
  786. X *                      access, use the "times ()" function. If you have
  787. X *                      neither, use a stopwatch in the dead of night.
  788. X *                      "printf"s are provided marking the points "Start Timer"
  789. X *                      and "Stop Timer". DO NOT use the UNIX "time(1)"
  790. X *                      command, as this will measure the total time to
  791. X *                      run this program, which will (erroneously) include
  792. X *                      the time to allocate storage (malloc) and to perform
  793. X *                      the initialization.
  794. X *              -DHZ=nnn                (default: 60)
  795. X *                      The function "times" returns process times in
  796. X *                      1/HZ seconds, with HZ = 60 for most systems.
  797. X *                      CHECK YOUR SYSTEM DESCRIPTION BEFORE YOU JUST APPLY
  798. X *                      THE DEFAULT VALUE.
  799. X *
  800. X ***************************************************************************
  801. X *
  802. X *  Compilation model and measurement (IMPORTANT):
  803. X *
  804. X *  This C version of Dhrystone consists of three files:
  805. X *  - dhry_global.h (this file, containing global definitions and comments)
  806. X *  - dhry_pack_1.c (containing the code corresponding to Ada package Pack_1)
  807. X *  - dhry_pack_2.c (containing the code corresponding to Ada package Pack_2)
  808. X *
  809. X *  The following "ground rules" apply for measurements:
  810. X *  - Separate compilation
  811. X *  - No procedure merging
  812. X *  - Otherwise, compiler optimizations are allowed but should be indicated
  813. X *  - Default results are those without register declarations
  814. X *  See the companion paper "Rationale for Dhrystone Version 2" for a more
  815. X *  detailed discussion of these ground rules.
  816. X *
  817. X *  For 16-Bit processors (e.g. 80186, 80286), times for all compilation
  818. X *  models ("small", "medium", "large" etc.) should be given if possible,
  819. X *  together with a definition of these models for the compiler system used.
  820. X *
  821. X **************************************************************************
  822. X *
  823. X *  Dhrystone (C version) statistics:
  824. X *
  825. X *  [Comment from the first distribution, updated for version 2.
  826. X *   Note that because of language differences, the numbers are slightly
  827. X *   different from the Ada version.]
  828. X *
  829. X *  The following program contains statements of a high level programming
  830. X *  language (here: C) in a distribution considered representative:           
  831. X *
  832. X *    assignments                  52 (51.0 %)
  833. X *    control statements           33 (32.4 %)
  834. X *    procedure, function calls    17 (16.7 %)
  835. X *
  836. X *  103 statements are dynamically executed. The program is balanced with
  837. X *  respect to the three aspects:                                             
  838. X *
  839. X *    - statement type
  840. X *    - operand type
  841. X *    - operand locality
  842. X *         operand global, local, parameter, or constant.                     
  843. X *
  844. X *  The combination of these three aspects is balanced only approximately.    
  845. X *
  846. X *  1. Statement Type:                                                        
  847. X *  -----------------             number
  848. X *
  849. X *     V1 = V2                     9
  850. X *       (incl. V1 = F(..)
  851. X *     V = Constant               12
  852. X *     Assignment,                 7
  853. X *       with array element
  854. X *     Assignment,                 6
  855. X *       with record component
  856. X *                                --
  857. X *                                34       34
  858. X *
  859. X *     X = Y +|-|"&&"|"|" Z        5
  860. X *     X = Y +|-|"==" Constant     6
  861. X *     X = X +|- 1                 3
  862. X *     X = Y *|/ Z                 2
  863. X *     X = Expression,             1
  864. X *           two operators
  865. X *     X = Expression,             1
  866. X *           three operators
  867. X *                                --
  868. X *                                18       18
  869. X *
  870. X *     if ....                    14
  871. X *       with "else"      7
  872. X *       without "else"   7
  873. X *           executed        3
  874. X *           not executed    4
  875. X *     for ...                     7  |  counted every time
  876. X *     while ...                   4  |  the loop condition
  877. X *     do ... while                1  |  is evaluated
  878. X *     switch ...                  1
  879. X *     break                       1
  880. X *     declaration with            1
  881. X *       initialization
  882. X *                                --
  883. X *                                34       34
  884. X *
  885. X *     P (...)  procedure call    11
  886. X *       user procedure      10
  887. X *       library procedure    1
  888. X *     X = F (...)
  889. X *             function  call      6
  890. X *       user function        5                                         
  891. X *       library function     1                                               
  892. X *                                --                                          
  893. X *                                17       17
  894. X *                                        ---
  895. X *                                        103
  896. X *
  897. X *    The average number of parameters in procedure or function calls
  898. X *    is 1.82 (not counting the function values as implicit parameters).
  899. X *
  900. X *
  901. X *  2. Operators
  902. X *  ------------
  903. X *                          number    approximate
  904. X *                                    percentage
  905. X *
  906. X *    Arithmetic             32          50.8                                 
  907. X *
  908. X *       +                     21          33.3                              
  909. X *       -                      7          11.1                              
  910. X *       *                      3           4.8
  911. X *       / (int div)            1           1.6
  912. X *
  913. X *    Comparison             27           42.8
  914. X *
  915. X *       ==                     9           14.3
  916. X *       /=                     4            6.3
  917. X *       >                      1            1.6
  918. X *       <                      3            4.8
  919. X *       >=                     1            1.6
  920. X *       <=                     9           14.3
  921. X *
  922. X *    Logic                   4            6.3
  923. X *
  924. X *       && (AND-THEN)          1            1.6
  925. X *       |  (OR)                1            1.6
  926. X *       !  (NOT)               2            3.2
  927. X * 
  928. X *                           --          -----
  929. X *                           63          100.1
  930. X *
  931. X *
  932. X *  3. Operand Type (counted once per operand reference):
  933. X *  ---------------
  934. X *                          number    approximate
  935. X *                                    percentage
  936. X *
  937. X *     Integer               175        72.3 %
  938. X *     Character              45        18.6 %
  939. X *     Pointer                12         5.0 %
  940. X *     String30                6         2.5 %
  941. X *     Array                   2         0.8 %
  942. X *     Record                  2         0.8 %
  943. X *                           ---       -------
  944. X *                           242       100.0 %
  945. X *
  946. X *  When there is an access path leading to the final operand (e.g. a record
  947. X *  component), only the final data type on the access path is counted.       
  948. X *
  949. X *
  950. X *  4. Operand Locality:                                                      
  951. X *  -------------------
  952. X *                                number    approximate
  953. X *                                          percentage
  954. X *
  955. X *     local variable              114        47.1 %
  956. X *     global variable              22         9.1 %
  957. X *     parameter                    45        18.6 %
  958. X *        value                        23         9.5 %
  959. X *        reference                    22         9.1 %
  960. X *     function result               6         2.5 %
  961. X *     constant                     55        22.7 %
  962. X *                                 ---       -------
  963. X *                                 242       100.0 %
  964. X *
  965. X *
  966. X *  The program does not compute anything meaningful, but it is syntactically
  967. X *  and semantically correct. All variables have a value assigned to them
  968. X *  before they are used as a source operand.
  969. X *
  970. X *  There has been no explicit effort to account for the effects of a
  971. X *  cache, or to balance the use of long or short displacements for code or
  972. X *  data.
  973. X *
  974. X ***************************************************************************
  975. X */
  976. X/* CONSTANTS */
  977. X#define INT_GLOB    5
  978. X#define BOOL_GLOB    1
  979. X#define ARR_1_SZ    8
  980. X#define ARR_1_VAL    7
  981. X#define STR_0_PAR_REF     "DHRYSTONE PROGRAM, SOME STRING"
  982. X#define STR_1_PAR_REF    "DHRYSTONE PROGRAM, 1'ST STRING"
  983. X#define STR_2_PAR_REF    "DHRYSTONE PROGRAM, 2'ND STRING"
  984. X
  985. X
  986. X/* Compiler and system dependent definitions: */
  987. X
  988. X#ifndef TIME
  989. X#ifndef TIMES
  990. X#define TIMES
  991. X#endif
  992. X#endif
  993. X                /* Use "times" function for measurement */
  994. X                /* unless explicitly defined otherwise  */
  995. X#ifndef HZ
  996. X#define HZ      60
  997. X#endif
  998. X                /* Use HZ = 60 for "times" function     */
  999. X                /* unless explicitly defined otherwise  */
  1000. X
  1001. X#ifdef TIMES
  1002. X#include <sys/types.h>
  1003. X#include <sys/times.h>
  1004. X                /* for "times" */
  1005. X#endif
  1006. X
  1007. X#define Mic_secs_Per_Second     1000000.0
  1008. X                /* UNIX C returns process times in seconds/HZ */
  1009. X
  1010. X#ifdef  NOSTRUCTASSIGN
  1011. X#define structassign(d, s)      memcpy(&(d), &(s), sizeof(d))
  1012. X#else
  1013. X#define structassign(d, s)      d = s
  1014. X#endif
  1015. X
  1016. X#ifdef  NOENUM
  1017. X#define Ident_1 0
  1018. X#define Ident_2 1
  1019. X#define Ident_3 2
  1020. X#define Ident_4 3
  1021. X#define Ident_5 4
  1022. X  typedef int   Enumeration;
  1023. X#else
  1024. X  typedef       enum    {Ident_1, Ident_2, Ident_3, Ident_4, Ident_5}
  1025. X                Enumeration;
  1026. X#endif
  1027. X        /* for boolean and enumeration types in Ada, Pascal */
  1028. X
  1029. X/* General definitions: */
  1030. X
  1031. X#include <stdio.h>
  1032. X                /* for strcpy, strcmp */
  1033. X
  1034. X#define Null 0 
  1035. X                /* Value of a Null pointer */
  1036. X#define true  1
  1037. X#define false 0
  1038. X
  1039. Xtypedef int     One_Thirty;
  1040. Xtypedef int     One_Fifty;
  1041. Xtypedef char    Capital_Letter;
  1042. Xtypedef int     Boolean;
  1043. Xtypedef char    Str_30 [31];
  1044. Xtypedef int     Arr_1_Dim [50];
  1045. Xtypedef int     Arr_2_Dim [50] [50];
  1046. X
  1047. Xtypedef struct record 
  1048. X    {
  1049. X    struct record *Ptr_Comp;
  1050. X    Enumeration    Discr;
  1051. X    union {
  1052. X          struct {
  1053. X                  Enumeration Enum_Comp;
  1054. X                  int         Int_Comp;
  1055. X                  char        Str_Comp [31];
  1056. X                  } var_1;
  1057. X          struct {
  1058. X                  Enumeration E_Comp_2;
  1059. X                  char        Str_2_Comp [31];
  1060. X                  } var_2;
  1061. X          struct {
  1062. X                  char        Ch_1_Comp;
  1063. X                  char        Ch_2_Comp;
  1064. X                  } var_3;
  1065. X          } variant;
  1066. X      } Rec_Type, *Rec_Pointer;
  1067. X
  1068. X
  1069. END_OF_FILE
  1070. if test 19075 -ne `wc -c <'dhry.h'`; then
  1071.     echo shar: \"'dhry.h'\" unpacked with wrong size!
  1072. fi
  1073. chmod +x 'dhry.h'
  1074. # end of 'dhry.h'
  1075. fi
  1076. echo shar: End of archive 4 \(of 5\).
  1077. cp /dev/null ark4isdone
  1078. MISSING=""
  1079. for I in 1 2 3 4 5 ; do
  1080.     if test ! -f ark${I}isdone ; then
  1081.     MISSING="${MISSING} ${I}"
  1082.     fi
  1083. done
  1084. if test "${MISSING}" = "" ; then
  1085.     echo You have unpacked all 5 archives.
  1086.     rm -f ark[1-9]isdone
  1087. else
  1088.     echo You still need to unpack the following archives:
  1089.     echo "        " ${MISSING}
  1090. fi
  1091. ##  End of shell archive.
  1092. exit 0
  1093. exit 0 # Just in case...
  1094.